import VisClassOrInterfaceNode from "@/types/VisClassOrInterfaceNode";
import VisEnumNode from "@/types/VisEnumNode";
import VisBaseNode from "@/types/VisBaseNode";
import EnumNode from "./EnumNode";
import CLassOrInterfaceNode from "./CLassOrInterfaceNode";

export default function TopLevelNode(props: { node: VisBaseNode }) {
  const { node } = props;
  if (node.typeName === "EnumNode") {
    // Enum
    return <EnumNode enumNode={node as VisEnumNode} />;
  } else {
    // class or interface
    return <CLassOrInterfaceNode coiNode={node as VisClassOrInterfaceNode} />;
  }
}
